using System;
using System.Collections.Generic;
using System.Text;

namespace LibGreen.Jabber.Utility
{
    /// <summary>
    /// A logging facility for JabberLib components
    /// </summary>
    internal static class Logging
    {
        private static bool logToConsole;

        /// <summary>
        /// Initializes the logger
        /// </summary>
        static Logging()
        {
#if DEBUG
            logToConsole = true;
#endif
        }

        /// <summary>
        /// Writes a formatted string to the log
        /// </summary>
        /// <param name="message">A formatting string</param>
        /// <param name="args">An array of objects to format</param>
        public static void LogString(string message, params object[] args)
        {
            if (logToConsole)
            {
                Console.WriteLine(message, args);
            }
        }
    }
}
